package com.epsoft.odin7cj.flow;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.Reader;

public class Test {

	public static void main(String[] args) throws Exception {
		
		try(
			InputStream is = new FileInputStream(ClassLoader.getSystemResource("Test.txt").getPath());
		){
			int i = is.read();
			System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
			i = is.read();
			System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
			i = is.read();
			System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
		}
		
		try(
				Reader read = new FileReader(ClassLoader.getSystemResource("Test.txt").getPath());
			){
				int i = read.read();
				System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
				i = read.read();
				System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
				i = read.read();
				System.out.println("decimal:"+i+", char:"+(char)i+",binary:"+Integer.toBinaryString(i)+",hex:"+Integer.toHexString(i));
			}
		

	}

}
